
#ifndef __M_LOGER_H__
#define __M_LOGER_H__

#include <iostream>
#include <cstdio>
#include <ctime>

#define INFO 0
#define DEBUG 1
#define ERR 2
#define default_LEVEL DEBUG

#define LOG(level,format,...) \
        do{\
        if(level<default_LEVEL)break;\
        time_t t=time(NULL);\
        struct tm* lt=localtime(&t);\
        char buff[32];\
        strftime(buff,31,"%H:%M:%S",lt);\
        fprintf(stdout,"[%s %s:%d]" format "\n",buff,__FILE__,__LINE__,##__VA_ARGS__);\
        }while(0)

#define ILOG(format,...) LOG(INFO,format,##__VA_ARGS__)
#define DLOG(format,...) LOG(DEBUG,format,##__VA_ARGS__)
#define ELOG(format,...) LOG(ERR,format,##__VA_ARGS__)



#endif